package br.com.merks.service;

import java.math.BigDecimal;
import java.util.List;

import javax.persistence.EntityManager;

import br.com.merks.controller.vo.MarketInfoVO;
import br.com.merks.controller.vo.TradeGraphVO;
import br.com.merks.model.Market;
import br.com.merks.model.MarketAnswer;
import br.com.merks.model.MarketComment;
import br.com.merks.model.Trade;
import br.com.merks.model.User;
import br.com.merks.service.exception.InsufficientFundsException;
import br.com.merks.service.exception.InsufficientMerksException;

public interface TradeService {
	public BigDecimal getCurrentPrice(Market market, MarketAnswer answer);
	public BigDecimal getAfterPrice(Market market, MarketAnswer answer,Trade tradeInput);
	public BigDecimal getTotalCost(Market market, MarketAnswer answer, Trade tradeInput);
	public Trade buy(Trade trade, User user) throws InsufficientFundsException;
	public List<Trade> listTransactions(Market market, User user);
	public MarketInfoVO getMarketUserTradeInfo(Market market, User user);
	public List<TradeGraphVO> tradeHistory(Trade trade);
	public Trade sell(Trade trade, User user) throws InsufficientMerksException;
	public void setEntityManager(EntityManager entityManager);
	
	
}